package com.guyao.gynews.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.guyao.gynews.R;
import com.guyao.gynews.bean.ClassMate;

import org.w3c.dom.Text;

import java.util.List;

/**
 * Created by Administrator on 2019/9/25.
 */

public class ClassMateAdapter  extends BaseAdapter{
    Context context;

    List<ClassMate.ListBean> listBeans;


    public  ClassMateAdapter(Context context,List<ClassMate.ListBean> listBeans){
        this.context = context;
        this.listBeans = listBeans;
    }
    @Override
    public int getCount() {
        return listBeans.size();
    }

    @Override
    public Object getItem(int position) {
        return listBeans.get(position);
    }

    @Override
    //下标
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = View.inflate(context , R.layout.classmate_listview,null);
        TextView classStuName = convertView.findViewById(R.id.clasamate_listview_stu);
        classStuName.setText(listBeans.get(position).getName()+"");
        return convertView;
    }
}
